<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 00:33:05
 * @LastEditTime: 2023-09-28 17:28:37
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 
 */

namespace App\Models;

use App\Traits\MaterialTrait;
use App\Traits\StorageTrait;


class MarketComplaintDetails extends BaseModel
    {
    use MaterialTrait;
    use StorageTrait;
    public $timestamps = true;
    public $table = "sys_market_complaint_details";
    protected $guarded = [];
    protected $casts = [];
    public function status()
        {
        return $this->belongsTo(Dic::class, "status_id", "key")->where(function ($q)
            {
            $q->where("code", 'status_with_finance');
            });
        }

    public function main()
        {
        return $this->belongsTo(MarketComplaint::class, "main_id");
        }

    public function department()
        {
        return $this->belongsTo(Department::class);
        }
    }
